// webpack.base.js
const path = require('path')

module.exports = {
    mode: 'development',
    module: {
        rules: [{
            test: /\.js$/,
            exclude: /node_modules/,
            use: {
                loader: "babel-loader",
                options: {
                    presets: [
                        [
                            "@babel/preset-env",
                            {
                                useBuiltIns: "usage"
                            }
                        ],  // 高级 js 语法
                        "@babel/preset-react" // jsx 语法
                    ]
                }
            }
        }]
    }
}